package edu.linyh;

import java.util.Scanner;

/**
 * @Author Linyh
 * @Description
 * @Date 2022/7/4 19:33
 **/

public class work {
    public static void main(String[] args) {
        System.out.println("输入密码长度：");
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if (n < 6) {
            System.out.println("密码长度不得小于6位数，请重新输入");
        } else {
            for (int j = 0; j < n; j++) {
                double rand = Math.random();
                double randTri = Math.random() * 3;
                if (randTri >= 0 && randTri < 1) {
                    System.out.print((char) (rand * ('9' - '0') + '0'));
                } else if (randTri >= 1 && randTri < 2) {
                    System.out.print((char) (rand * ('Z' - 'A') + 'A'));
                } else {
                    System.out.print((char) (rand * ('z' - 'a') + 'a'));
                }
            }
        }
    }
}